package com.csy.chat;

import com.csy.mysql_util.MysqlUtil;

import java.sql.SQLException;

public class Get_chat_History {
    private StringBuffer time[]=new StringBuffer[800];
    private StringBuffer name[]=new StringBuffer[800];
    private StringBuffer talk[]=new StringBuffer[800];
    private int length=0;
    public Get_chat_History()
    {
        MysqlUtil temp = new MysqlUtil();
        {
            try
            {
                this.length = temp.Get_chat_content(time, name, talk);
            }
            catch (ClassNotFoundException ex)
            {
                ex.printStackTrace();
            }
            catch (SQLException ex)
            {
                ex.printStackTrace();
            }
        }
    }

    public int getLength()
    {
        return this.length;
    }

    public StringBuffer getTime(int i)
    {
        return this.time[i];
    }

    public StringBuffer getName(int i)
    {
        return this.name[i];
    }

    public StringBuffer getTalk(int i)
    {
        return this.talk[i];
    }


    public void print()
    {
        for(int i=0;i<this.length;i++)
        {
            System.out.println(time[i]);
            System.out.println(name[i] + ":" + talk[i]);
        }

    }
}
